'use strict';
const moment = require('moment-timezone');
require('moment-timezone/data/packed/latest.json'); // 导入所有时区数据

module.exports = async (app, router, conf) => {
   // 在此处应用中间件等 启动时最后调用此处

   if (conf.moment) {
      moment.locale(conf.moment.locale);
      moment.tz.setDefault(conf.moment.timezone);
   }

   if (conf?.fsAttachment) {
      const fsAttachment = require('@fs/attachment')
      fsAttachment.entry(app, router, conf?.fsAttachment)
   }
   // .eg 跨平台数据请求
   if (conf.env == 'development') {
      app.fs.xiaReq.get('/ftavg', {
         query: {
            action: 'start'
         }
      }).then((res, err) => {
         console.info(`平均启动时间：${res?.avg} ms`);
      }, err => { })
   }
}
